Optimal. Leaf size=24 \[ \frac{1}{3} a \sin ^3(x)+\frac{1}{3} b \cos ^3(x)-b \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.041309, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3089, 2564, 30, 2633} \[ \frac{1}{3} a \sin ^3(x)+\frac{1}{3} b \cos ^3(x)-b \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3089
Rule 2564
Rule 30
Rule 2633
Rubi steps
\begin{align*} \int \sin ^2(x) (a \cos (x)+b \sin (x)) \, dx &=\int \left (a \cos (x) \sin ^2(x)+b \sin ^3(x)\right ) \, dx\\ &=a \int \cos (x) \sin ^2(x) \, dx+b \int \sin ^3(x) \, dx\\ &=a \operatorname{Subst}\left (\int x^2 \, dx,x,\sin (x)\right )-b \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (x)\right )\\ &=-b \cos (x)+\frac{1}{3} b \cos ^3(x)+\frac{1}{3} a \sin ^3(x)\\ \end{align*}
Mathematica [A] time = 0.0038364, size = 26, normalized size = 1.08 \[ \frac{1}{3} a \sin ^3(x)-\frac{3}{4} b \cos (x)+\frac{1}{12} b \cos (3 x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.021, size = 20, normalized size = 0.8 \begin{align*} -{\frac{b \left ( 2+ \left ( \sin \left ( x \right ) \right ) ^{2} \right ) \cos \left ( x \right ) }{3}}+{\frac{a \left ( \sin \left ( x \right ) \right ) ^{3}}{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.12823, size = 27, normalized size = 1.12 \begin{align*} \frac{1}{3} \, a \sin \left (x\right )^{3} + \frac{1}{3} \,{\left (\cos \left (x\right )^{3} - 3 \, \cos \left (x\right )\right )} b \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.483446, size = 77, normalized size = 3.21 \begin{align*} \frac{1}{3} \, b \cos \left (x\right )^{3} - b \cos \left (x\right ) - \frac{1}{3} \,{\left (a \cos \left (x\right )^{2} - a\right )} \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.35743, size = 27, normalized size = 1.12 \begin{align*} \frac{a \sin ^{3}{\left (x \right )}}{3} - b \sin ^{2}{\left (x \right )} \cos{\left (x \right )} - \frac{2 b \cos ^{3}{\left (x \right )}}{3} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.10847, size = 34, normalized size = 1.42 \begin{align*} \frac{1}{12} \, b \cos \left (3 \, x\right ) - \frac{3}{4} \, b \cos \left (x\right ) - \frac{1}{12} \, a \sin \left (3 \, x\right ) + \frac{1}{4} \, a \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]